package stark.app.function.fdy;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.stark.stkplayer.BaseStkResAdapter;

import androidx.annotation.NonNull;
import androidx.databinding.BindingAdapter;
import stark.app.AppConfig;
import stark.app.BR;
import stark.app.R;
import stark.app.databinding.ItemVideoPreviewBinding;

public class VideoItemAdapter extends BaseStkResAdapter<ItemVideoPreviewBinding> {

    public VideoItemAdapter() {
        super(R.layout.item_video_preview, BR.dynamicBean);
    }

    @BindingAdapter({"videoCoverUrl"})
    public static void setVideoCoverUrl(ImageView iv, String url) {
        Glide.with(iv).load(url).placeholder(android.R.color.white).into(iv);
    }

    @NonNull
    @Override
    protected String getVideoResUrl() {
        return AppConfig.VIDEO_RES_URL;
    }
}
